//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
    {
        //登录页面
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录', //菜单标题
            hidden: true, //代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
            icon: 'Promotion', //菜单文字左侧的图标,支持element-plus全部图标
            requiresAuth: false,// 不需要登录
        },
    },
    {
        //注册页面
        path: '/register',
        component: () => import('@/views/register/index.vue'),
        name: 'register',
        meta: {
            title: '注册',
            hidden: true,
            icon: 'Promotion',
            requiresAuth: false,
        },
    },
    {
        //登录成功以后展示数据的路由
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        meta: {
            title: '首页',
            hidden: false,
            icon: '',
            requiresAuth: false,
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                name: 'home',
                meta: {
                    title: '首页',
                    hidden: false,
                    icon: 'HomeFilled',
                    requiresAuth: false,
                },
            },
            {
                path: '/search',
                component: () => import('@/views/search/index.vue'),
                name: 'search',
                meta: {
                    title: '搜索结果',
                    hidden: true, // 不在导航栏中显示
                    requiresAuth: false,
                },
            },
            {
                path: '/order/confirm',
                component: () => import('@/views/order/OrderConfirm.vue'),
                name: 'OrderConfirm',
                meta: {
                    title: '立即购买',
                    hidden: true, // 不在导航栏中显示
                    requiresAuth: true, // 需要登录
                },
            },
            {
                path: '/order/pay',
                component: () => import('@/views/order/OrderPay.vue'),
                name: 'OrderPay',
                meta: {
                    title: '立即支付',
                    hidden: true, // 不在导航栏中显示
                    requiresAuth: true, // 需要登录
                },
            },
            {
                path: '/user/userInfo',
                component: () => import('@/views/user/person.vue'),
                name: 'userInfoHome',
                meta: {
                    title: '个人信息',
                    icon: 'ChatDotSquare',
                    hidden: true,
                    requiresAuth: true,
                },
            },
            {
                path: '/user/userAddress',
                component: () => import('@/views/user/userAddress.vue'),
                name: 'userAddressHome',
                meta: {
                    title: '收货地址',
                    icon: 'ChatDotSquare',
                    hidden: true,
                    requiresAuth: true,
                },
            },
            {
                path: '/user/userOrder',
                component: () => import('@/views/user/userOrder.vue'),
                name: 'userOrderHome',
                meta: {
                    title: '订单信息',
                    icon: 'ChatDotSquare',
                    hidden: true,
                    requiresAuth: true,
                },
            },
            {
                path: '/user/userCart',
                component: () => import('@/views/user/userCart.vue'),
                name: 'userCartHome',
                meta: {
                    title: '购物车信息',
                    icon: 'ChatDotSquare',
                    hidden: true,
                    requiresAuth: true,
                },
            },
            {
                path: '/checkout/multi',
                name: 'MultiCheckout',
                component: () => import('@/views/order/MultiCheckout.vue'),
                meta: {
                    title: '多选结算',
                    hidden: true,
                    requiresAuth: true,
                },
            },
            {
                path: '/pay/paySuccess',
                component: () => import('@/views/pay/payment-success.vue'),
                name: 'OrderPaySuccess',
                meta: {
                    title: '支付成功',
                    hidden: true, // 不在导航栏中显示
                    requiresAuth: false, // 需要登录
                },
            },
            {
                path: '/pay/payFail',
                component: () => import('@/views/pay/payment-failure.vue'),
                name: 'OrderPayFail',
                meta: {
                    title: '支付失败',
                    hidden: true, // 不在导航栏中显示
                    requiresAuth: false, // 需要登录
                },
            },
        ],
    },
    {
        path: '/restaurant',
        component: () => import('@/layout/index.vue'),
        name: 'Restaurant',
        meta: {
            title: '所有餐厅',
            icon: 'ChatDotSquare',
            hidden: false,
            requiresAuth: false,
        },
        redirect: '/restaurant/home',
        children: [
            {
                path: '/restaurant/home',
                component: () => import('@/views/restaurant/index.vue'),
                name: 'RestaurantHome',
                meta: {
                    title: '所有餐厅',
                    icon: 'ChatDotSquare',
                    hidden: false,
                    requiresAuth: false,
                },
            },
        ]
    },
    {
        path: '/dishCategory',
        component: () => import('@/layout/index.vue'),
        name: 'DishCategory',
        meta: {
            title: '菜品分类',
            icon: 'ChatDotSquare',
            hidden: false,
            requiresAuth: false,
        },
        redirect: '/dishCategory/home',
        children: [
            {
                path: '/dishCategory/home',
                component: () => import('@/views/dishCategory/index.vue'),
                name: 'DishCategoryHome',
                meta: {
                    title: '菜品分类',
                    icon: 'ChatDotSquare',
                    hidden: false,
                    requiresAuth: false,
                },
            },
        ]
    },
    {
        //404
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true,
            icon: 'DocumentDelete',
            requiresAuth: false,
        },
    },
    {
        //任意路由
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            title: '任意路由',
            hidden: true,
            icon: 'DataLine',
            requiresAuth: false,
        },
    }
]

